using NUnit.Framework;
using Rainbow.ObjectFlow.Interfaces;
using Shouldly;
using objectflow.core.tests.integration.TestOperations;
using Rainbow.ObjectFlow.Framework;

namespace objectflow.core.tests.integration
{    
    public class WorkflowAbstractions 
    {
        [Test]
        public void WorkflowContainerClass()
        {
            var rainbowWorkflow = new RainbowColours();
            var result = rainbowWorkflow.Start(new Colour("Red"));

            result.Name.ShouldBe("R e d R e d");
        }

        [Test]
        public void CanUseAsSubWorkflow()
        {
            var rainbowWorkflow = new RainbowColours();
            var workflow = new Workflow<Colour>();
            workflow.Do(rainbowWorkflow);
            Workflow<Colour>.Definition().Do(rainbowWorkflow);

            var result = workflow.Start(new Colour("Red"));

            result.Name.ShouldBe("R e d R e d");

        }

    }
}